package com.erlang.springbootconfig;

import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.stereotype.Component;

import java.util.Arrays;

/**
 * 配置读取
 *
 * @Author ZGQ
 */
@Component
@ConfigurationProperties(prefix = "person")
public class Person {

  private String name;
  private String[] address;
  private int age;

  public String getName() {
    return name;
  }

  public void setName(String name) {
    this.name = name;
  }

  public int getAge() {
    return age;
  }

  public void setAge(int age) {
    this.age = age;
  }

  public String[] getAddress() {
    return address;
  }

  public void setAddress(String[] address) {
    this.address = address;
  }

  @Override
  public String toString() {
    return "Person{" +
        "name='" + name + '\'' +
        ", address=" + Arrays.toString(address) +
        ", age=" + age +
        '}';
  }
}
